4. Integration by Parts

Recall:       \(\displaystyle \int u\,dv=u\,v-\int v\,du\)   where   \(du=\dfrac{du}{dx}\,dx\)   and   \(dv=\dfrac{dv}{dx}\,dx\)

a2. Integration by Parts with Multiple Steps

Sometimes you will need to apply integration by parts more than once:

Compute \(\displaystyle \int x^2\cos x\,dx\)

We apply integration by parts with \[\begin{array}{ll} u=x^2 & dv=\cos x\,dx \\ du=2x\,dx \quad & v=\sin x \end{array}\] So: \[ \int x^2\cos x\,dx =x^2\sin x-2\int x\,\sin x\,dx \] Notice that the remaining integral is simpler than the original integral because there is only an \(x\) instead of an \(x^2\). The idea is to keep reducing the power until there are no \(x\)'s left. So to evaluate the second integral, we need to apply integration by parts again, this time with \[\begin{array}{ll} u=x & dv=\sin x\,dx \\ du=\,dx \quad & v=-\cos x \end{array}\] This gives: \[\begin{aligned} \int x^2\cos x\,dx &=x^2\sin x-2\left(-x\cos x+\int \cos x\,dx\right) \\ &=x^2\sin x-2(-x\cos x+\sin x)+C \\ &=x^2\sin x+2x\cos x-2\sin x+C \end{aligned}\]

It is important that in the second step we picked \(u=x\) rather than \(u=\sin x\). Otherwise, we will go in circles as shown here:

Starting at the second integral in the example above, we have \[ \int x^2\cos x\,dx=x^2\sin x-2\int x\sin x\,dx \] If we then choose the parts to be \[\begin{array}{ll} u=\sin x & dv=x\,dx \\ du=\cos x\,dx \quad & v=\dfrac{1}{2}x^2 \end{array}\] It takes us back to \[\begin{aligned} \int x^2\cos x\,dx &=x^2\sin x-2\left(\dfrac{1}{2}x^2\sin x-\int \dfrac{1}{2}x^2\cos x\,dx\right) \\ &=x^2\sin x-x^2\sin x+\int x^2\cos x\,dx \\ &=\int x^2\cos x\,dx \end{aligned}\] which is where we started from. So, since we take the polynomial for \(u\) the first time, we must keep the polynomial for \(u\) the second time.

Compute the integral \(\displaystyle \int (x^2-3x)e^x\,dx\)

\(\displaystyle \int (x^2-3x)e^x\,dx =(x^2-5x+5)e^x+C\)

First we'll set \[\begin{array}{ll} u=x^2-3x & dv=e^x\,dx \\ du=(2x-3)\,dx \quad & v=e^x \end{array}\] So we find that \[\begin{aligned} \int (x^2-3x)e^x\,dx =(x^2-3x)e^x-\int (2x-3)e^x\,dx \end{aligned}\] So now we set \[\begin{array}{ll} u=2x-3 & dv=e^x\,dx \\ du=2\,dx \quad & v=e^x \end{array}\] Which gives us \[\begin{aligned} \int (x^2-3x)e^x\,dx &=(x^2-3x)e^x-\left[(2x-3)e^x-\int 2e^x\,dx\right] \\ &=(x^2-3x)e^x-(2x-3)e^x+\int 2e^x\,dx \\ &=(x^2-3x)e^x-(2x-3)e^x+2e^x+C \\ &=(x^2-5x+5)e^x+C \end{aligned}\]

Using the Product Rule, if \(f(x)=(x^2-5x+5)e^x\), then \[ f'(x)=(2x-5)e^x+(x^2-5x+5)e^x =(x^2-3x)e^x \] as desired.

Notice that since the polynomial was quadratic, we needed to do integration by parts twice. In the next example, the polynomial is cubic. So we expect three integrations by parts.

Compute the integral \(\displaystyle \int x^3\cos x\,dx\)

\(\displaystyle \int x^3\cos x =x^3\sin x+3x^2\cos x-6x\sin x-6\cos x+C\)

\(\begin{array}{ll} u=x^3 & dv=\cos x\,dx \\ du=3x^2\,dx \quad & v=\sin x \end{array}\) \[ \int x^3\cos x\,dx=x^3\sin x-3\int x^2\sin x\,dx \] \(\begin{array}{ll} u=x^2 & dv=\sin x\,dx \\ du=2x\,dx \quad & v=-\cos x \end{array}\) \[ =x^3\sin x-3\left(-x^2\cos x-\int -2x\cos x\,dx\right) \] Simplify: \[ =x^3\sin x+3x^2\cos x-6\int x\cos x\,dx \] \(\begin{array}{ll} u=x & dv=\cos x\,dx \\ du=dx \quad & v=\sin x \end{array}\) \[ =x^3\sin x+3x^2\cos x-6\left(x\sin x-\int \sin x\,dx\right) \] Simplify: \[ =x^3\sin x+3x^2\cos x-6x\sin x+6\int \sin x\,dx \] \(\int \sin x\,dx=-\cos x+C\): \[ =x^3\sin x+3x^2\cos x-6x\sin x-6\cos x+C \]

Using the Product Rule, if \(f(x)=x^3\sin x+3x^2\cos x-6x\sin x-6\cos x\), then \[\begin{aligned} f'(x)&=3x^2\sin x+x^3\cos x+6x\cos x-3x^2\sin x-6\sin x-6x\cos x+6\sin x \\ &=x^3\cos x \end{aligned}\] as desired.

© MYMathApps

Supported in part by NSF Grant #1123255